package com.xneure.utils.upload;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name = "uploadFile",urlPatterns = "/uploadFile",loadOnStartup = 1)
public class UploadTest extends HttpServlet{
	private static final long serialVersionUID = -1629103793482952693L;

	@Override
	protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException{
		super.doPost(req,resp);
		PartFileResolver ufr = new PartFileResolver(req);
		for(;ufr.hashNext();){
			FileItem part = ufr.nextFile();
			System.out.println(part.getValue());
		}
	}
}
